package com.jvmoutofmemory.octopus.ui;

import javax.swing.*;
import java.awt.*;

public class MainOctopusFrame extends JFrame {

    private OctopusMenu octopusMenu;
    private OctopusManagerPanel octopusManagerPanel;

    public void initialize() {
        this.setLayout(new BorderLayout());
        this.setTitle("Octopus批量打印");
        this.setSize(1000, 700);

        octopusMenu = new OctopusMenu(this);
        octopusMenu.initialize();
        this.add(octopusMenu, BorderLayout.NORTH);

        octopusManagerPanel = new OctopusManagerPanel(this);
        octopusManagerPanel.initialize();
        this.getContentPane().add(octopusManagerPanel, BorderLayout.CENTER);

        this.setLocationRelativeTo(null);
    }

    public Integer getPrintIntervalSecond() {
        return octopusMenu.getPrintIntervalSecond();
    }

    public OctopusTableModel getOctopusTableModel() {
        return octopusManagerPanel.getTableModel();
    }

    public void renderTableData() {
        octopusManagerPanel.renderTableData();
    }

    public JTable getFilesTable() {
        return octopusManagerPanel.getFilesInfoTable();
    }

}
